function fn({ type = 'get', url, data } = {}) {
    return new Promise((resolve, reject) => {
        $.ajax({
            type,
            url,
            data,
            success(res) {
                resolve([null, res])
            },
            error(err) {
                resolve([err, undefined])
            }
        })
    })
}